
<script type="text/javascript" >
            function logbookAction()
            {
                if(document.getElementById('txtCekLogin').value == '0')
                {
                $(".logbook-popUp").animate({
                      "top": "0"
                    }, "slow");
                }
                else
                    {
                        alert('Anda Dalam Keadaan Login! Silahkan Logout Terlebih Dahulu');
                    }
            };
            function eventAction()
            {
                if(document.getElementById('txtCekLogin').value == '0')
                {
                $(".event-popUp").animate({
                      "top": "0"
                    }, "slow");
                }
                else
                    {
                        alert('Anda Dalam Keadaan Login! Silahkan Logout Terlebih Dahulu');
                    }
            };
            
            function closeLogbook_overlay(){
               
               $(".logbook-popUp").animate({
                  "top": "-300%"
                }, "slow");
                document.getElementById('input_log').value = "";
                document.getElementById('input_pas').value = "";
                document.getElementById('button_log').value = "";
                $("div#status_loginLB").html("");
            };
            
            function closeEvent_overlay(){
               
               $(".event-popUp").animate({
                  "top": "-300%"
                }, "slow");
                document.getElementById('input_log_ev').value = "";
                document.getElementById('input_pas_ev').value = "";
                document.getElementById('button_log_ev').value = "";
                $("div#status_submit").html("");
            };
            
            function loginLB(){
                $.ajax({
                        type: "POST",
                        url: $("#logbook_form").attr('action'),
                        data: $("#logbook_form").serialize(),
                        dataType: 'json',
                        success: function(json) {
                                if (json.status_loginLB) {
                                        var res = json.status_loginLB.toString();
                                        if(res == "masuk"){
                                            $("div#status_loginLB").html("Login Sukses!");
                                            closeLogbook_overlay();
                                            window.location = "<?php echo base_url().'index.php/logbook'?>";
                                        }
                                        $("div#status_loginLB").html(res);
                                }
                        }
                    });
                    return false; 
            }
            
            function loginEV(){
                $.ajax({
                        type: "POST",
                        url: $("#event_form").attr('action'),
                        data: $("#event_form").serialize(),
                        dataType: 'json',
                        success: function(json) {
                                if (json.status_loginEV) {
                                        var res = json.status_loginEV.toString();
                                        if(res == "masuk"){
                                            $("div#status_loginEV").html("Login Sukses!");
                                            closeEvent_overlay();
                                            window.location = "<?php echo base_url().'index.php/eventman'?>";
                                        }
                                        $("div#status_loginEV").html(res);
                                }
                        }
                    });
                    return false; 
            }
            </script>
        <img src="<?php echo base_url().'/assets/home/banner.png' ?>" width ="100%" height="100%" />
        <div class="logbook-tombol" onclick="logbookAction();">Log Book Management </div>
        <div class="event-tombol" onclick="eventAction();">Event Management</div>
    
<!--    Cek Session  -->
    <input type="hidden" id="txtCekLogin" name="txtCekLogin" value="<?php if($username){echo '1';}else {echo '0';}?>" />
    <?php if($username){ ?>
    
        <div class="status-user">
                <div class="name_user">Hello <a href="<?php echo base_url().'index.php/member'?>"><?php echo $username ?></a> &nbsp |</div>
                <a href="<?php echo base_url().'index.php/home/logout'?>"><div class="log-user">Logout</div></a>
        </div>
    <?php } ?>
    
    
     

